package com.jingdong.dao.order.impl;

import com.jingdong.dao.order.OrderItemDao;
import com.jingdong.model.Order_items;
import com.jingdong.utils.MyBatisUtils;
import org.apache.ibatis.session.SqlSession;
import org.springframework.stereotype.Repository;

@Repository
public class OrderItemDaoImpl implements OrderItemDao {
    @Override
    public int addOrderItem(Order_items orderItem) {
        try {
            SqlSession sqlSession= MyBatisUtils.getSqlSession();
            int resultId=  sqlSession.insert("com.jingdong.orderItemModel.save",orderItem);
            sqlSession.commit();
            sqlSession.close();
            return resultId;
        }catch (Exception E){
            E.printStackTrace();
        }
        return 0;
    }
}
